feat(sessions): Add EAP double-write for user sessions#5588
feat(sessions): Add EAP double-write for user sessions#5588noahsmartin wants to merge 10 commits intomasterfrom
Conversation
When the `UserSessionsEap` feature flag is enabled, session data is sent both through the legacy metrics pipeline and directly to the snuba-items topic as TRACE_ITEM_TYPE_USER_SESSION TraceItems. This enables migration to the new EAP-based user sessions storage. Includes a Datadog metric `sessions.eap.produced` tagged with `session_type` (update/aggregate) to track EAP writes. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
21e22bf to
6acd029
Compare
There was a problem hiding this comment.
I didn't review in-depeth, as this we're going to need a different approach.
Session processing can stay as it is, we still need to extract sessions into metrics and aggregate them through the metrics pipeline to keep aggregation in-place.
Right now, you can check the implementation in services/store.rs where session metrics are separated from other "generic" metrics into the sessions topic. This is going to be the entry point where we can start double writing.
Long term, we'd want to have a more strictly typed version of aggregation for metrics, by re-using the generic metrics pipeline but properly typed. This will require some more work though.
Regarding rollout: What is the preferred rollout strategy, via a feature flag? I recommend instead doing a global rollout rate defined in "global config", this is usually the approach we're taking for controlling double writes to Kafka.
ed7c367 to
1a745cd
Compare
1a745cd to
d56e867
Compare
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2806e9e to
3dfbfcd
Compare
|
I made some changes:
Big question for me is how the |
3dfbfcd to
1ab932d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
We decided using a random id for trace and item id is what we prefer for the moment. |
When the
UserSessionsEapfeature flag is enabled, session data is sent both through the legacy metrics pipeline and directly to the snuba-items topic as TRACE_ITEM_TYPE_USER_SESSION TraceItems.This enables migration to the new EAP-based user sessions storage.
Cursor Bugbot found 2 potential issues for commit 1a745cd